﻿using FluentMigrator;
using Smartstore.Core.Identity;

namespace Smartstore.Core.Data.Migrations
{
    [MigrationVersion("2024-09-30 11:37:00", "Core: ManagedStoreId")]
    internal class ManagedStoreId : Migration
    {
        public override void Up()
        {
            var tableName = nameof(Customer);
            var managedStoreId = nameof(Customer.ManagedStoreId);

            if (!Schema.Table(tableName).Column(managedStoreId).Exists())
            {
                Create.Column(managedStoreId).OnTable(tableName).AsInt32().NotNullable().WithDefaultValue(0);
            }
        }

        public override void Down()
        {
        }
    }
}
